1. Field of the Invention
This invention relates generally to computers, and more particularly to computer code implemented to assist in the boot up process of a computer system.
2. Description of the Related Art
Today""s personal computer systems provide users with a high degree of flexibility in terms of the number of peripheral devices that may be connected to a given system. Users are generally able to connect additional internal and external peripheral devices to meet the storage or data access demands required to complete the user""s job. By way of example, users can connect additional internal or external hard drives, compact disc (CD) players, digital video disc (DVD) players, compact disc recordables (CD-Rs), etc. Typically, these devices are connected to a system via an IDE or SCSI connection. In some cases, the system will need a host adapter card, such as a SCSI host adapter card, which allows the user to connect between 1 and 15 internal and external SCSI devices.
As computing power for users continues to increase, these users will also experience an increased need for data storage. Although computer hard drives are able to store large volumes of data, users often find it critical to have additional hard drives. These additional hard drives can either be internal or external, and are typically used to store backup copies of important files, other operating systems, or simply more data.
In certain circumstances, the user who previously installed another operating system onto one of the additional hard drives may want to boot the computer system from the additional hard drive. Unfortunately, the system BIOS that controls the initial booting process will not allow booting to a disk other than the primary hard disk. To better understand this limitation, reference is now made to FIG. 1, which is a simplified diagram of a primary disk 10 of the computer system""s main hard drive. The primary disk 10 will have an outer track 12, which contains the master boot record (MBR) 14. At bootup, the system BIOS assigns an INT 13 disk number to each of the physical disks that may be connected to the system. The primary disk 10 will always be designated as the boot disk because it is assigned the first disk number, which is 80h. The system BIOS will then call a bootstrap code that is part of the MBR 14 of the primary disk 10. The bootstrap code will examine the disk""s partition tables in order to find the active partition that points to the address location of the operating system. At that point, the operating system takes control and completes the bootup process.
As can be appreciated, although computer systems may be configured to have more than one hard drive, users are not easily able to boot from those drives in an easy manner. If the user is a sophisticated user, the user may be able open up the computer system and rearrange the hard drive connections so as to make one of the additional hard drives the primary drive. Although this may work, such a task is time consuming, and may not be practical when the user simply wants to boot from another drive for a short period of time and then wants to return to boot from the primary drive.
In view of the foregoing, there is a need for a method and computer code for enabling a user to select and boot from any hard drive that may be connected to the computer system.
Broadly speaking, the present invention fills these needs by providing methods, and computer readable media containing program instructions for enabling users of a computer system to boot the computer system from any one of the drives that may be connected to the computer system. It should be appreciated that the present invention can be implemented in numerous ways, including as a process, an apparatus, a system, or a device. Several inventive embodiments of the present invention are described below.
In one embodiment, a method for booting a computer system from a selected disk is disclosed. The selected disk is one of two or more disks that may be connected to the computer system. The method includes reading into memory a first boot select code and reading into memory master boot record (MBR) sector data from an MBR sector location of a primary disk of the computer system. The method then proceeds to merging partition table information of the MBR sector data with the first boot select code to produce boot select MBR sector data (i.e., ABS-1). Then, the method moves to where the boot select MBR sector data is written into the MBR sector location to replace the MBR sector data. The method now proceeds to read a second boot select code (i.e., ABS-2) into memory and then write it to one or more sectors of the primary disk. The boot select MBR sector data is configured to work with the second boot select code to provide a user the ability to boot from any one of the disks connected to the computer system.
In another embodiment, a primary disk media containing program instructions for enabling a user to boot from any disk connected to a computer system is disclosed. The primary disk media contains a first boot select code that includes partition table information. The first boot select code is defined in a master boot record (MBR) location of the primary disk media. A second boot select code is defined in a plurality of sectors following the MBR location. The first boot select code is configured to link with the second boot select code to provide the ability of booting to any one of the disks that are connected to the computer system having the primary disk media.
In yet a further embodiment, an computer readable media containing program instructions for booting a computer system from a selected disk is disclosed. The selected disk is one of two or more disks that may be connected to the computer system. The computer readable media includes: (a) program instructions for reading into memory a first boot select code; (b) program instructions for reading into memory master boot record (MBR) sector data from an MBR sector location of a primary disk of the computer system; (c) program instructions for merging partition table information of the MBR sector data with the first boot select code to produce boot select MBR sector data; (d) program instructions for writing the boot select MBR sector data into the MBR sector location to replace the MBR sector data; (e) program instructions for loading a second boot select code; and (f) program instructions for writing the second boot select code into one or more sectors of the primary disk. The boot select MBR sector data is configured to work with the second boot select code to provide a user the ability to select booting from any one of the disks connected to the computer system.
Other aspects and advantages of the invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.